package TransactionImplementation

import (
	"SPC/AbstractTransactions"
	"SPC/Database"
	"SPC/Model"
	"SPC/ModelImplementation"
)

type ChangeUnaffiliatedTransaction struct {
	AbstractTransactions.ChangeAffiliationTransaction
}

func NewChangeUnaffiliatedTransaction(empid int)*ChangeUnaffiliatedTransaction{
	n := &ChangeUnaffiliatedTransaction{
		*AbstractTransactions.NewChangeAffiliationTransaction(empid),
	}
	n.ChangeAffiliationTransaction.RecordMembership = n.RecordMembership
	n.ChangeAffiliationTransaction.GetAffiliation = n.GetAffiliation
	return n
}

func (c *ChangeUnaffiliatedTransaction)RecordMembership(e Model.Employee){
	//af := e.GetAffiliation()
	uaf := ModelImplementation.UnionAffiliation{}
	memberId := uaf.GetMemberId()
	Database.GetPayrollDatabase().RemoveUnionMember(memberId)
}

func (c *ChangeUnaffiliatedTransaction)GetAffiliation()Model.Affiliation {
	return &Model.NoAffiliation{}
}